#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("isbn.in", "r", stdin);
	freopen("isbn.out", "w", stdout);
	char a , b , c , d , e , f , g , h , i , j , k , l , m , x = '0' , y = '0';
	int A , C , D , E , G , H , I , J , K , M , X , Y;
	cin >> a >> b >> c >> d >> e >> f >> g >> h >> i >> j >> k >> l >> m;
	A = a - '0';
	C = c - '0';
	D = d - '0';
	E = e - '0';
	G = g - '0';
	H = h - '0';
	I = i - '0';
	J = j - '0';
	K = k - '0';
	M = m - '0';
	X = x - '0';
	Y = y - '0';
	if(m == 'X'){
		M = 10;
	}
	X = 1 * A + 2 * C + 3 * D + 4 * E + 5 * G + 6 * H + 7 * I + 8 * J + 9 * K;
	Y = X % 11;
	if(Y == M){
		cout << "Right" << endl;
		return 0;
	}
	else{
		if(Y != 10){
			y = Y + '0';
			cout << a << b << c << d << e << f << g << h << i << j << k << l << y << endl;
			return 0;
		}
		else if(Y == 10){
			cout << a << b << c << d << e << f << g << h << i << j << k << l << 'X' << endl;
			return 0;
		}
	}
}
